﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Threading;

// GetTPB, Copyright Mirosław M. Mączka.  All Rights Reserved. This code released under the terms of the Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
namespace GetTpb
{
    public static class Extensions
    {
        public static bool EQ(this string a, string b)
        {
            return 0 == string.Compare(a, b, true);
        }
        public static bool SW(this string a, string b)
        {
            return a.StartsWith(b, StringComparison.CurrentCultureIgnoreCase);
        }
        public static bool EW(this string a, string b)
        {
            return a.EndsWith(b, StringComparison.CurrentCultureIgnoreCase);
        }
        private static Action EmptyDelegate = delegate() { };
        public static void Refresh(this UIElement uiElement)
        {
            uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
        }
        //
    }//class
}//namespace
